package leetcode_2501_2600;

import java.util.HashSet;
import java.util.Set;

public class LeeCode_2543_2 {
    public static void main(String[] args) {
        System.out.println(isReachable(6, 9));
        System.out.println(isReachable(4, 7));
    }
    private static boolean isReachable(int targetX, int targetY) {
        int g = gcd(targetX, targetY);
        return (g & (g - 1)) == 0;
    }
    private static int gcd(int x, int y){
        while (x != 0){
            int tmp = x;
            x = y % x;
            y = tmp;
        }
        return y;
    }
}
